package com.dianping.cat.consumer.event.model.entity;

import com.dianping.cat.consumer.event.model.BaseEntity;
import com.dianping.cat.consumer.event.model.IVisitor;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;









public class EventType
  extends BaseEntity<EventType>
{
  private String m_id;
  private long m_totalCount;
  private long m_failCount;
  private double m_failPercent;
  private String m_successMessageUrl;
  private String m_failMessageUrl;
  private Map<String, EventName> m_names = new ConcurrentHashMap();


  private double m_tps;


  private GraphTrend m_graphTrend;



/*  35 */   public EventType(String id) { this.m_id = id; }




/*  40 */   public void accept(IVisitor visitor) { visitor.visitType(this); }


  public EventType addName(EventName name) {
/*  44 */     this.m_names.put(name.getId(), name);
/*  45 */     return this;
  }


  public boolean equals(Object obj) {
/*  50 */     if (obj instanceof EventType) {
/*  51 */       EventType _o = (EventType)obj;

/*  53 */       if (!equals(getId(), _o.getId())) {
/*  54 */         return false;
      }

/*  57 */       return true;
    }

/*  60 */     return false;
  }


/*  64 */   public EventName findName(String id) { return (EventName)this.m_names.get(id); }


  public EventName findOrCreateName(String id) {
/*  68 */     EventName name = (EventName)this.m_names.get(id);

/*  70 */     if (name == null) {
/*  71 */       synchronized (this.m_names) {
/*  72 */         name = (EventName)this.m_names.get(id);

/*  74 */         if (name == null) {
/*  75 */           name = new EventName(id);
/*  76 */           this.m_names.put(id, name);
        }
      }
    }

/*  81 */     return name;
  }


/*  85 */   public long getFailCount() { return this.m_failCount; }



/*  89 */   public String getFailMessageUrl() { return this.m_failMessageUrl; }



/*  93 */   public double getFailPercent() { return this.m_failPercent; }



/*  97 */   public GraphTrend getGraphTrend() { return this.m_graphTrend; }



/* 101 */   public String getId() { return this.m_id; }



/* 105 */   public Map<String, EventName> getNames() { return this.m_names; }



/* 109 */   public String getSuccessMessageUrl() { return this.m_successMessageUrl; }



/* 113 */   public long getTotalCount() { return this.m_totalCount; }



/* 117 */   public double getTps() { return this.m_tps; }





  public EventType incFailCount() {
/* 130 */     this.m_failCount++;
/* 131 */     return this;
  }

  public EventType incFailCount(long failCount) {
/* 135 */     this.m_failCount += failCount;
/* 136 */     return this;
  }

  public EventType incTotalCount() {
/* 140 */     this.m_totalCount++;
/* 141 */     return this;
  }

  public EventType incTotalCount(long totalCount) {
/* 145 */     this.m_totalCount += totalCount;
/* 146 */     return this;
  }


  public void mergeAttributes(EventType other) {
/* 151 */     assertAttributeEquals(other, "type", "id", this.m_id, other.getId());

/* 153 */     this.m_totalCount = other.getTotalCount();

/* 155 */     this.m_failCount = other.getFailCount();

/* 157 */     this.m_failPercent = other.getFailPercent();

/* 159 */     this.m_tps = other.getTps();
  }


/* 163 */   public EventName removeName(String id) { return (EventName)this.m_names.remove(id); }


  public EventType setFailCount(long failCount) {
/* 167 */     this.m_failCount = failCount;
/* 168 */     return this;
  }

  public EventType setFailMessageUrl(String failMessageUrl) {
/* 172 */     this.m_failMessageUrl = failMessageUrl;
/* 173 */     return this;
  }

  public EventType setFailPercent(double failPercent) {
/* 177 */     this.m_failPercent = failPercent;
/* 178 */     return this;
  }

  public EventType setGraphTrend(GraphTrend graphTrend) {
/* 182 */     this.m_graphTrend = graphTrend;
/* 183 */     return this;
  }

  public EventType setId(String id) {
/* 187 */     this.m_id = id;
/* 188 */     return this;
  }

  public EventType setSuccessMessageUrl(String successMessageUrl) {
/* 192 */     this.m_successMessageUrl = successMessageUrl;
/* 193 */     return this;
  }

  public EventType setTotalCount(long totalCount) {
/* 197 */     this.m_totalCount = totalCount;
/* 198 */     return this;
  }

  public EventType setTps(double tps) {
/* 202 */     this.m_tps = tps;
/* 203 */     return this;
  }

  public EventType() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/event/model/entity/EventType.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */